<template>
  <draggable class="list-group" :list="dragList" group="people" :move="checkMove">
    <q-chip icon="album" :color="color" v-for="(element) in dragList" :key="element.id" class="q-ma-xs">
      {{element.name}}-{{element.name_en}}
    </q-chip>
  </draggable>
</template>

<script>
import draggable from 'vuedraggable'
export default {
  name: 'pubItem',
  props: {
    dragList: {
      type: Array,
      default: null
    },
    showPv: {
      type: Boolean,
      default: false
    },
    color: {
      type: String,
      default: null
    }
  },
  methods: {
    checkMove (evt) {
      return evt.to.getAttribute('id') === 'gray' ? evt.draggedContext.element.allow_gray : true
    }
  },
  components: {
    draggable
  }
}
</script>

<style scoped>

</style>
